<?php

namespace app\command;

use app\common\command\BaseCommand;
use libs\JWT;
use think\console\Input;
use think\console\Output;
use think\console\input\Argument;
use libs\Log;

class Test extends BaseCommand
{
    protected function configure()
    {
        $this->setName('h5')
            ->addArgument('func', Argument::OPTIONAL, "argument::optional", 'h5')
            ->setDescription('this is a description');
    }

    protected function execute(Input $input, Output $output)
    {
        try {
            $jwt = new JWT();
            $token = $jwt->encode(['uID' => 2]);
            echo $token;
        } catch (\Exception $ex) {
            $this->output->error($ex->getMessage());
            return Log::err($ex->getMessage());
        }
    }
}
